<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="coinfaces">

        <title>选择查看 Systemd 启动日志</title>

    <link rel="stylesheet" href="../theme/css/style.css">
    <link rel="stylesheet" href="../theme/css/pygments.css">



</head>

<body>
    <div class="content">
<h1>选择查看 Systemd 启动日志</h1>    <p>
        under
            <a href="../tags/systemd/">Systemd</a>
    </p>
    <p>
        in <a href="../categories/uncategorized/">Uncategorized</a>
    </p>
    <p>Published: 2019-04-02</p>


    <!-- wp:paragraph -->

<p>使用 journalctl 命令的 --boot (-b)
选项可以选择查看某次启动过程的启动日志：</p>
<!-- /wp:paragraph -->

<!-- wp:code -->

<div class="highlight"><pre><span></span><code><span class="o">#</span> <span class="err">以下</span><span class="mi">3</span><span class="err">条命令都查看最近一次启动日志</span>
<span class="n">journalctl</span> <span class="o">-</span><span class="n">b</span>
<span class="n">journalctl</span> <span class="o">-</span><span class="n">b</span> <span class="mi">0</span>
<span class="n">journalctl</span> <span class="o">-</span><span class="n">b</span> <span class="o">-</span><span class="mi">0</span>

<span class="n">journalctl</span> <span class="o">-</span><span class="n">b</span> <span class="mi">1</span>  <span class="o">#</span> <span class="err">查看第</span><span class="mi">1</span><span class="err">次启动日志</span>
<span class="n">journalctl</span> <span class="o">-</span><span class="n">b</span> <span class="mi">2</span>  <span class="o">#</span> <span class="err">查看第</span><span class="mi">2</span><span class="err">次启动日志</span>
<span class="o">#</span> <span class="err">依次类推</span>

<span class="n">journalctl</span> <span class="o">-</span><span class="n">b</span> <span class="o">-</span><span class="mi">1</span> <span class="o">#</span> <span class="err">查看倒数第</span><span class="mi">2</span><span class="err">次启动日志</span>
<span class="n">journalctl</span> <span class="o">-</span><span class="n">b</span> <span class="o">-</span><span class="mi">2</span> <span class="o">#</span> <span class="err">查看倒数第</span><span class="mi">3</span><span class="err">次启动日志</span>
<span class="o">#</span> <span class="err">依次类推</span>
</code></pre></div>


<!-- /wp:code -->

<!-- wp:paragraph -->

<!-- /wp:paragraph -->
    </div>
<nav class="nav sidebar">
    <div class="siteinfo">
        <div class="sitename"><a href="..">coinfaces</a></div>
        <div class="tagline">Another Side of Life</div>
    </div>

        <a href="../categories/">categories</a>
        <a href="..">&larr; Home</a>
</nav><footer class="footer">
    <span>
        &copy; jpli &middot;
        under <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">CC-BY-SA 4.0</a>
    </span>
    |
    <span>
        Powered by:
        <a href="http://blog.getpelican.com/">Pelican</a>
    </span>
</footer></body>
</html>